<!--
 * createor: zc
 * email: zc8023zs@163.com
 * create_time: 2020/3/14 13:46:24
 *-->
<template>
  <el-container>
    <el-header>
      用户佣金明细表详情
    </el-header>
    <el-main>
      <el-form label-width="200px" :inline="true" style="padding:5% 5% 0 5%">
        <el-form-item label="结算明细id：">
          <span>{{formData.id}}</span>
        </el-form-item>
        <el-form-item label="用户id：">
          <span>{{formData.user_id}}</span>
        </el-form-item>
        <el-form-item label="子订单id：">
          <span>{{formData.sub_order_id}}</span>
        </el-form-item>
        <el-form-item label="子订单编号：">
          <span>{{formData.sub_order_num}}</span>
        </el-form-item>
        <el-form-item label="1一级返佣 2二级返佣 3三级返佣：">
          <span>{{formData.level}}</span>
        </el-form-item>
        <el-form-item label="提现id：">
          <span>{{formData.apply_id}}</span>
        </el-form-item>
        <el-form-item label="售后单id：">
          <span>{{formData.service_id}}</span>
        </el-form-item>
        <el-form-item label="金额 正为收入 负为支出：">
          <span>{{formData.trade_commission}}</span>
        </el-form-item>
        <el-form-item label="结算类型 1下单收入 2退款支出 3提现支出：">
          <span>{{formData.type}}</span>
        </el-form-item>
        <el-form-item label="状态 0待结算 1已结算 2已取消：">
          <span>{{formData.status}}</span>
        </el-form-item>
        <el-form-item label="创建时间：">
          <span>{{formData.add_time}}</span>
        </el-form-item>
        <el-form-item label="结算时间：">
          <span>{{formData.settlement_time}}</span>
        </el-form-item>
        <el-form-item label="备注：">
          <span>{{formData.remark}}</span>
        </el-form-item>
        <el-form-item label="汇总id：">
          <span>{{formData.commission_id}}</span>
        </el-form-item>
      </el-form>
    </el-main>
  </el-container>
</template>
<style scoped>
body .app-container .el-container,
body .app-container .el-header,
body .app-container .el-main,
body .el-container,
body .el-header,
body .el-main {
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
</style>
<script>
import { Loading } from "element-ui";
import {
  jbr_user_commission_listInfo
} from '@/api/project/wmyh/project_wmyh_jbr_user_commission_list'
export default {
  name: "a_wmyha_jbr_user_commission_list_info",
  data() {
    return {
      infoLoading: false,
      formData:{
        id: 0, 
        user_id: 0, 
        sub_order_id: 0, 
        sub_order_num: '', 
        level: 0, 
        apply_id: 0, 
        service_id: 0, 
        trade_commission: 0.0, 
        type: 0, 
        status: 0, 
        add_time: '2020/8/11 10:52:36', 
        settlement_time: '2020/8/11 10:52:36', 
        remark: '', 
        commission_id: 0, 
      }
    };
  },
  activated() {
    var result = location.search.match(new RegExp("[\?\&]id=([^\&]+)", "i"));
    if(result != null || result.length > 0){
      this.onInfo(result[1]);
    }
  },
  methods: {
    onInfo(id){
      this.infoLoading=true;
      jbr_user_commission_listInfo({id:id}).then(r=>{
        this.formData.id = r.dataSingle.id, 
        this.formData.user_id = r.dataSingle.user_id, 
        this.formData.sub_order_id = r.dataSingle.sub_order_id, 
        this.formData.sub_order_num = r.dataSingle.sub_order_num, 
        this.formData.level = r.dataSingle.level, 
        this.formData.apply_id = r.dataSingle.apply_id, 
        this.formData.service_id = r.dataSingle.service_id, 
        this.formData.trade_commission = r.dataSingle.trade_commission, 
        this.formData.type = r.dataSingle.type, 
        this.formData.status = r.dataSingle.status, 
        this.formData.add_time = r.dataSingle.add_time, 
        this.formData.settlement_time = r.dataSingle.settlement_time, 
        this.formData.remark = r.dataSingle.remark, 
        this.formData.commission_id = r.dataSingle.commission_id, 
        this.infoLoading=false;
      }).catch(()=>{
        this.infoLoading=false;
      });
    }
  }
}
</script>
